import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
const routes = [
  {
    path: '/',
    redirect: '/reglog'
  },
  { // 登录相关
    path: '/reglog',
    name: 'reglog',
    components: {
      default: () => import('@/components/login/RegAndLog')
    }
  },
  {
    path: '/reg',
    name: 'reg',
    components: {
      default: () => import('@/components/login/Reg')
    }
  },
  {
    path: '/log',
    name: 'log',
    components: {
      default: () => import('@/components/login/Log')
    }
  },
  {
    path: '/weixin',
    name: 'weixin',
    components: {
      default: () => import('@/components/login/WeiXin')
    }
  },
  {
    path: '/qq',
    name: 'qq',
    components: {
      default: () => import('@/components/login/Qq')
    }
  },
  {
    path: '/weibo',
    name: 'weibo',
    components: {
      default: () => import('@/components/login/WeiBo')
    }
  },
  // 时光记及相关页
  {
    path: '/time',
    name: 'time',
    components: {
      default: () => import('@/components/timeNotes/TimeNotes'),
      footer: () => import('@/components/Footer')
    }
  },
  // 消息路由
  {
    path: '/news',
    name: 'news',
    components: {
      default: () => import('@/components/new/News'),
      footer: () => import('@/components/Footer')
    }
  },
  // 聊天路由
  {
    path: '/Chat',
    name: 'chat',
    components: {
      default: () => import('@/components/new/Chat'),
      footer: () => import('@/components/Footer')
    }
  },
  // 我的路由
  {
    path: '/mine',
    name: 'mine',
    components: {
      default: () => import('@/components/mine/Mine'),
      footer: () => import('@/components/Footer')
    }
  },
  // 设置路由
  {
    path: '/set',
    name: 'set',
    components: {
      default: () => import('@/components/mine/Set'),
      footer: () => import('@/components/Footer')
    }
  },
  // 会员中心
  {
    path: '/vipcenter',
    name: 'vipcenter',
    components: {
      default: () => import('@/components/mine/VipCenter')
    }
  },
  // 相册制作
  {
    path: '/photo',
    name: 'photo',
    components: {
      default: () => import('@/components/mine/Photo')
    }
  },
  // 我的收藏
  {
    path: '/collect',
    name: 'collect',
    components: {
      default: () => import('@/components/mine/Collect')
    }
  },
  // 购物车
  {
    path: '/cart',
    name: 'cart',
    components: {
      default: () => import('@/components/mine/Cart')
    }
  },
  // 我的订单
  {
    path: '/order',
    name: 'order',
    components: {
      default: () => import('@/components/mine/Order')
    }
  },
  // // 订单下面的全部
  {
    path: '/orderall',
    name: 'orderall',
    components: {
      default: () => import('@/components/order/OrderAll')
    }
  },
  // 订单下面的待付款
  {
    path: '/ordermoney',
    name: 'ordermoney',
    components: {
      default: () => import('@/components/order/OrderMoney')
    }
  },
  // 订单下面的待收货
  {
    path: '/ordergoods',
    name: 'ordergoods',
    components: {
      default: () => import('@/components/order/OrderGoods')
    }
  },
  // 订单下面的待发货
  {
    path: '/ordersend',
    name: 'ordersend',
    components: {
      default: () => import('@/components/order/OrderSend')
    }
  },
  // 订单下面的已完成
  {
    path: '/ordercomplete',
    name: 'ordercomplete',
    components: {
      default: () => import('@/components/order/OrderComplete')
    }
  },
  // 订单下面的评价
  {
    path: '/ordercomment',
    name: 'ordercomment',
    components: {
      default: () => import('@/components/order/OrderComment')
    }
  },
  // 订单下面的售后
  {
    path: '/ordersale',
    name: 'ordersale',
    components: {
      default: () => import('@/components/order/OrderSale')
    }
  },
  // 优惠券
  {
    path: '/coupon',
    name: 'coupon',
    components: {
      default: () => import('@/components/mine/Coupon')
    }
  },
  // 锦囊部分
  {
    path: '/silk',
    name: 'silk',
    components: {
      default: () => import('@/components/silkBag/SilkBag'),
      footer: () => import('@/components/Footer')
    }
  },
  // 生活及相关页
  {
    path: '/life',
    name: 'life',
    components: {
      default: () => import('@/components/life/Life'),
      footer: () => import('@/components/Footer')
    },
    children: [
      {
        path: '',
        redirect: 'nofollow'
      },
      {
        path: 'follow',
        components: {
          default: () => import('@/components/life/LifeFollow'),
          footer: () => import('@/components/Footer')
        }
      },
      {
        path: 'nofollow',
        components: {
          default: () => import('@/components/life/LifeNoFollow'),
          footer: () => import('@/components/Footer')
        }
      }
    ]
  },
  {
    // 社区页及相关页--备孕、孕期、育儿、家庭、旅行
    path: '/community',
    name: 'community',
    components: {
      default: () => import('@/components/life/Community')
    },
    children: [
      {
        path: '',
        redirect: 'cart-baby'
      },
      {
        path: 'ready',
        components: {
          default: () => import('@/components/life/ComReady')
        }
      },
      {
        path: 'pregnant',
        components: {
          default: () => import('@/components/life/ComPregnant')
        }
      },
      {
        path: 'cart-baby',
        components: {
          default: () => import('@/components/life/ComBaby')
        }
      },
      {
        path: 'family',
        components: {
          default: () => import('@/components/life/ComFamily')
        }
      },
      {
        path: 'travel',
        components: {
          default: () => import('@/components/life/ComTravel')
        }
      }
    ]
  },
  {
    // 优品页
    path: '/products',
    name: 'products',
    components: {
      default: () => import('@/components/life/Products')
    }
  },
  {
    // 优品页--清洁类商品
    path: '/clean',
    name: 'clean',
    components: {
      default: () => import('@/components/life/ProClean')
    }
  },
  {
    // 优品页--喂养类商品
    path: '/feed',
    name: 'feed',
    components: {
      default: () => import('@/components/life/ProFeed')
    }
  },
  {
    // 优品页--童装类商品
    path: '/clothes',
    name: 'clothes',
    components: {
      default: () => import('@/components/life/ProClothes')
    }
  },
  {
    // 优品页--宝宝必备
    path: '/babyneed',
    name: 'babyneed',
    components: {
      default: () => import('@/components/life/ProBabyneed')
    }
  },
  {
    // 优品页--更多商品
    path: '/more',
    name: 'more',
    components: {
      default: () => import('@/components/life/ProMore')
    }
  },
  {
    // 优品页--商品详情页
    path: '/prodetail',
    name: 'prodetail',
    components: {
      default: () => import('@/components/life/ProDetail')
    }
  },
  {
    // 优品页--商品详情页
    path: '/prodetail2',
    name: 'prodetail2',
    components: {
      default: () => import('@/components/life/ProDetail2')
    }
  },
  {
    // 优品页--商品评价页
    path: '/comment',
    name: 'comment',
    components: {
      default: () => import('@/components/life/ProComment')
    }
  },
  // 时光记及相关页
  {
    path: '/time',
    name: 'time',
    components: {
      default: () => import('@/components/timeNotes/TimeNotes'),
      footer: () => import('@/components/Footer')
    }
  },
  {
    path: '/information',
    name: 'information',
    components: {
      default: () => import('@/components/timeNotes/BabyInformation')
    }
  },
  {
    // 相册页
    path: '/photos',
    name: 'photos',
    components: {
      default: () => import('@/components/timeNotes/Photo')
    }
  },
  {
    // 成长记录页
    path: '/grow',
    name: 'grow',
    components: {
      default: () => import('@/components/timeNotes/Grow')
    },
    children: [
      {
        path: '',
        redirect: 'rember'
      },
      {
        path: 'rember',
        components: {
          default: () => import('@/components/timeNotes/GrowRember')
        }
      },
      {
        path: 'heigth',
        components: {
          default: () => import('@/components/timeNotes/GrowHeight')
        }
      },
      {
        path: 'weight',
        components: {
          default: () => import('@/components/timeNotes/GrowWeight')
        }
      },
      {
        path: 'header',
        components: {
          default: () => import('@/components/timeNotes/GrowHeader')
        }
      }
    ]
  },
  {
    // 成就页
    path: '/achievement',
    name: 'achievement',
    components: {
      default: () => import('@/components/timeNotes/Achievement')
    }
  },
  {
    // 亲友团页
    path: '/friends',
    name: 'friends',
    components: {
      default: () => import('@/components/timeNotes/Friends')
    }
  },
  // 消息路由
  {
    path: '/news',
    name: 'news',
    components: {
      default: () => import('@/components/new/News'),
      footer: () => import('@/components/Footer')
    }
  },
  // 我的路由
  {
    path: '/mine',
    name: 'mine',
    components: {
      default: () => import('@/components/mine/Mine'),
      footer: () => import('@/components/Footer')
    }
  },
  // 会员中心
  {
    path: '/vipcenter',
    name: 'vipcenter',
    components: {
      default: () => import('@/components/mine/VipCenter')
    }
  },
  // 食谱页路由及相关页
  {
    path: '/recipes',
    name: 'recipes',
    components: {
      default: () => import('@/components/silkBag/Recipes')
    }
  },
  {
    path: '/eat',
    name: 'eat',
    components: {
      default: () => import('@/components/silkBag/RecipesEat')
    },
    children: [
      {
        path: '',
        redirect: 'foods'
      },
      {
        path: 'foods',
        components: {
          default: () => import('@/components/silkBag/RecipesEatFoods')
        }
      },
      {
        path: 'staplefood',
        components: {
          default: () => import('@/components/silkBag/RecipesStaplefood')
        }
      },
      {
        path: 'egg',
        components: {
          default: () => import('@/components/silkBag/RecipesEgg')
        }
      },
      {
        path: 'fruits',
        components: {
          default: () => import('@/components/silkBag/RecipesFruits')
        }
      }
    ]
  },
  {
    // 食谱页
    path: '/book',
    name: 'book',
    components: {
      default: () => import('@/components/silkBag/RecipesBook')
    },
    children: [
      {
        path: '',
        redirect: 'yunqi'
      },
      {
        path: 'yunqi',
        components: {
          default: () => import('@/components/silkBag/RecBookYunqi')
        }
      },
      {
        path: 'chanhou',
        components: {
          default: () => import('@/components/silkBag/RecBookChanhou')
        }
      },
      {
        path: 'inbaby',
        components: {
          default: () => import('@/components/silkBag/RecBookInbaby')
        }
      },
      {
        path: 'Five',
        components: {
          default: () => import('@/components/silkBag/RecBookFive')
        }
      },
      {
        path: 'Seafood',
        components: {
          default: () => import('@/components/silkBag/RecBookSeafood')
        }
      },
      {
        path: 'Egg',
        components: {
          default: () => import('@/components/silkBag/RecBookEgg')
        }
      }
    ]
  },
  {
    // 我的收藏页
    path: '/collection',
    name: 'collection',
    components: {
      default: () => import('@/components/silkBag/RecipesCollection')
    }
  },
  // 百科页路由
  {
    path: '/hundred',
    name: 'hundred',
    components: {
      default: () => import('@/components/silkBag/Hundred')
    }
  },
  {
    // 百科--孕前准备页
    path: '/yunqian',
    name: 'yunqian',
    components: {
      default: () => import('@/components/silkBag/HundredReady')
    }
  },
  {
    // 百科-- 孕前检查页
    path: '/inspect',
    name: 'inspect',
    components: {
      default: () => import('@/components/silkBag/HundredInspect')
    }
  },
  {
    // 百科-- 孕期页
    path: '/inlife',
    name: 'inlife',
    components: {
      default: () => import('@/components/silkBag/HundredInlife')
    }
  },
  {
    // 百科-- 产后页
    path: '/after',
    name: 'after',
    components: {
      default: () => import('@/components/silkBag/HundredAfter')
    }
  },
  // 问答页路由
  {
    path: '/answer',
    name: 'answer',
    components: {
      default: () => import('@/components/silkBag/Answer')
    }
  },
  // 详情页的各种路由
  {
    // path: '/detail:id',
    path: '/detail',
    name: 'detail',
    components: {
      default: () => import('@/components/silkBag/Detail')
    }
  }
]
const router = new Router({
  routes: routes
})
export default router
